package org.triumphxx.springboot.eventlistener.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.triumphxx.springboot.eventlistener.base.Event;

/**
 * @author: wangyp
 * @Date: 2023/7/14
 * @Time: 9:54
 * @Desc: 事件监听器
 **/
@Component
@Slf4j
public class EventsListener {
    /**
     * 事件监听
     * @param event
     */
    @Async
    @EventListener
    public void handelListener(Event event){
        event.sendMsg();
        event.sendMail();
        event.other();
    }

}
